FIG. 32 is a block diagram showing an example configuration of a conventional image coding apparatus that codes moving pictures. A scheme such as H.264 which is an already-standardized moving picture coding scheme is used in the coding of moving pictures (for example, see Non Patent Literature (NPL) 1). In the image coding apparatus in FIG. 32, inter prediction coding is performed by way of an inter prediction control unit 131 controlling an inter prediction unit 112, according to a picture type (for example, the slice type in H.264) determined by a picture type determination unit 124 and a motion vector predictor competition flag (hereafter denoted as “mv_competition_flag”) outputted by a motion vector predictor competition flag switching unit 125. Specifically, the inter prediction control unit 131 switches the method of calculating for the motion vector predictor for the motion vector coding to be used in the inter coding of each prediction unit block, according to the picture type, such as a P-picture (for example, the P-slice in H.264) or a B-picture (for example, the B-slice in H.264) and to whether the mv_competition_flag is ON or OFF.
The mv_competit on_flag is included in first header information (for example, the slice header in H.264) that is attached to a bitstream on a first processing unit (for example, slice in H.264) basis, and is notified from the image coding apparatus to an image decoding apparatus. When the mv_competition_flag is ON, the image coding apparatus generates, as motion vector predictor candidates, for example, one or more motion vectors used around each prediction unit block, and attaches, to the bitstream, the index number of the motion vector predictor candidate that is ultimately used in the prediction of the motion vector of each prediction unit block. When the mv_competition_flag is OFF, the image coding apparatus generates one motion vector predictor from, for example, motion vectors used around the respective prediction unit blocks, and codes the motion vector using such motion vector predictor.
FIG. 33A shows an example of the motion vector predictor candidate generation by the conventional image coding apparatus when the mv_competition_flag is ON. The image coding apparatus first calculates the neighboring prediction unit blocks located left (neighboring block A), above (neighboring block B), and to the upper right (neighboring block C) of the prediction unit block, and calculates each of motion vectors MV_A, MV_B, and MV_C. Next, the image coding apparatus calculates a median motion vector Median (MV_A, MV_B, MV_C) using an intermediate value of the respective components of the motion vectors MV_A, MV_B, MV_C, and attaches a motion vector predictor index 0 to the median motion vector Median (MV_A, MV_B, MV_C). Furthermore, the image coding apparatus attaches motion vector predictor indices 1, 2, and 3 to the respective motion vectors in the order of MV_A, MV_B, and MV_C. FIG. 33B is a table showing the correspondence relationship between the motion vector predictor indices and the motion vector predictor candidates. The image coding apparatus selects the most efficient motion vector predictor candidate for the coding of the motion vector of the current prediction block to be coded, and attaches the index number of the selected motion vector predictor candidate to the bitstream. Furthermore, when all the motion vector predictor candidates are vectors having the same value, and so on, the image coding apparatus reduces the number of candidates by merging vectors, and performs processing such as not attaching a motion vector predictor index to the bitstream when the final number of candidates is 1.
FIG. 34 is a block diagram showing an example configuration of an image decoding apparatus corresponding to the conventional image coding apparatus in FIG. 32. A scheme such as H.264 which is an already-standardized moving picture decoding scheme is used in the decoding of moving pictures. In the image decoding apparatus in FIG. 34, inter prediction decoding is performed by way of an inter prediction control unit 231 controlling an inter prediction unit 212, according to the mv_competition_flag attached to the bitstream, and the motion vector predictor index.